package com.haixiaoke.saas.manage.messageCenter.controller;

import java.util.List;

import com.haixiaoke.saas.common.core.domain.AjaxResult;
import com.haixiaoke.saas.common.core.page.TableDataInfo;
import com.haixiaoke.saas.messageCenter.domain.PushRecord;
import com.haixiaoke.saas.messageCenter.service.IPushRecordService;
import com.haixiaoke.saas.system.BaseController;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 推送记录信息Controller
 *
 * @author xiaolong
 * @date 2024-11-19
 */
@RestController
@RequestMapping("/manage/messageCenter/pushRecord")
public class ManagePushRecordController extends BaseController {
    @Autowired
    private IPushRecordService pushRecordService;

    /**
     * 查询推送记录信息列表
     */
    @PreAuthorize("@ss.hasPermi('manage:pushRecord:list')")
    @GetMapping("/list")
    public TableDataInfo list(PushRecord pushRecord) {
        startPage();
        List<PushRecord> list = pushRecordService.selectPushRecordList(pushRecord);
        return getDataTable(list);
    }


    /**
     * 获取推送记录信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('manage:pushRecord:query')")
    @GetMapping(value = "/{pushRecordId}")
    public AjaxResult getInfo(@PathVariable("pushRecordId") Long pushRecordId) {
        return success(pushRecordService.getInfo(pushRecordId));
    }
}
